//
//  SNOrderFormListFooterModel.m
//  app
//
//  Created by 王少宁 on 15/5/7.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "SNOrderFormListFooterModel.h"

@implementation SNOrderFormListFooterModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if ([super init]) {
        
        DLog(@"%@",dict);
        
        _lastPayMoeny = [NSString stringWithFormat:@"%.2f",[dict[@"lastmoney"] floatValue]];
        _express_fee = [NSString stringWithFormat:@"%.2f",[dict[@"express_fee"] floatValue]];
        _gold2money = [NSString stringWithFormat:@"%.2f",[dict[@"gold"][@"gold2money"] floatValue]];
        _orderTotal = dict[@"gold"][@"orderTotal"];
        //原价总计 : 商品列表中所有的商品的 单价*购买数量 的和.
        _originallyMoney = dict[@"originallymoney"];
        //折扣总计 : 原价总计 + 运费 - 合计支付
        _rebateMoney = [NSString stringWithFormat:@"%.2f",_originallyMoney.floatValue + _express_fee.floatValue - _lastPayMoeny.floatValue];
        
        _orderTotal2Money = [NSString stringWithFormat:@"%.2f",[_orderTotal floatValue]*0.01];
    }
    return self;
}

+ (instancetype)modelWithDict:(NSDictionary *)dict
{
    return [[self alloc] initWithDict:dict];
}

@end
